﻿


@model BlogKickStart.Models.Post /*New*/
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@*<script type="text/javascript">
		document.write("<link href=\"&#64;");
		document.write("Url.Content('~/Content/");
		@ViewBag.themeName
		document.write(".css')' rel='stylesheet' type='text/css'/>");
</script>*@
@*@Html.Raw("<link href=\"") @Html.Raw("@") @Html.Raw("Url.Content(\"~/Content/\"") @Html.Raw("@") @Html.Raw("ViewBag.themeName" + "\".css\")\" rel=\"stylesheet\" type=\"text/css\"/>");*@
@using(Html.BeginForm("Comment", "BlogPost")){
<div id="Editor" class="Editor" onreadystatechange="loadtoggle()">
	<div class="HTMLDiv">      
		<div class="wmd-panel">
            <div id="wmd-button-bar-second"></div>
            <textarea class="wmd-input" name="unMarked" id="wmd-input-second"></textarea>
        </div>
		<div class="editnavbar"> 
				<ul class="navlist"> 
						<li><em>
							@Html.HiddenFor(n => n.PostID)
							<input type="submit" value="Save" /> 
						</em></li> 
				</ul> 
		</div>
        <div id="wmd-preview-second" class="wmd-panel wmd-preview"></div>
	</div>

	<div class="PlainDiv">
		@Html.Partial("PlainTextEditor")
	</div>
</div>

}


<script type="text/javascript">
	(function () {
		var converter1 = Markdown.getSanitizingConverter();
		var editor1 = new Markdown.Editor(converter1);
		editor1.run();

		var converter2 = new Markdown.Converter();

		converter2.hooks.chain("preConversion", function (text) {
			return text.replace(/\b(a\w*)/gi, "*$1*");
		});

		converter2.hooks.chain("plainLinkText", function (url) {
			return "This is a link to " + url.replace(/^https?:\/\//, "");
		});

		var help = function () { alert("Do you need help?"); }
		var options = {
			helpButton: { handler: help },
			strings: { quoteexample: "whatever you're quoting, put it right here" }
		};
		var editor2 = new Markdown.Editor(converter2, "-second", options);

		editor2.run();
	})();
</script>

